﻿using BindType = ToLuaMenu.BindType;
// using quicksdk;


public static class CustomSettings
{
    public static string toluaBaseType = LuaFramework.AppConst.FrameworkRoot + "/ToLua/BaseType/";
    public static string injectionFilesPath = LuaFramework.AppConst.FrameworkRoot + "/ToLua/Injection/";

	// public static string metaBackupDir
	// {
	// 	get
    //     {
	// 		return System.IO.Path.GetDirectoryName(UnityEngine.Application.dataPath) + "/meta_backup";
	// 	}
	// }

    //导出时强制做为静态类的类型(注意customTypeList 还要添加这个类型才能导出)
    //unity 有些类作为sealed class, 其实完全等价于静态类
    public static System.Collections.Generic.List<System.Type> staticClassTypes = new System.Collections.Generic.List<System.Type>
    {        
        typeof(UnityEngine.Application),
        typeof(UnityEngine.Time),
        typeof(UnityEngine.Screen),
        typeof(UnityEngine.SleepTimeout),
        typeof(UnityEngine.Input),
//        typeof(UnityEngine.Resources),
        typeof(UnityEngine.Physics),
        typeof(UnityEngine.RenderSettings),
        typeof(UnityEngine.QualitySettings),
        typeof(UnityEngine.GL),
        typeof(UnityEngine.Graphics),
        typeof(UnityEngine.Physics2D),
    };

    //附加导出委托类型(在导出委托时, customTypeList 中牵扯的委托类型都会导出， 无需写在这里)
    public static DelegateType[] customDelegateList = 
    {        
        _DT(typeof(System.Action)),                
        _DT(typeof(UnityEngine.Events.UnityAction)),
        _DT(typeof(System.Predicate<int>)),
        _DT(typeof(System.Action<int>)),
        _DT(typeof(System.Comparison<int>)),
        _DT(typeof(System.Func<int, int>)),
    };

    //在这里添加你要导出注册到lua的类型列表
    public static BindType[] customTypeList =
    {   
        //------------------------为例子导出--------------------------------
        //_GT(typeof(TestEventListener)),
        //_GT(typeof(TestProtol)),
        //_GT(typeof(TestAccount)),
        //_GT(typeof(Dictionary<int, TestAccount>)).SetLibName("AccountMap"),
        //_GT(typeof(KeyValuePair<int, TestAccount>)),
        //_GT(typeof(Dictionary<int, TestAccount>.KeyCollection)),
        //_GT(typeof(Dictionary<int, TestAccount>.ValueCollection)),
        //_GT(typeof(TestExport)),
        //_GT(typeof(TestExport.Space)),
        //------------------------------------------------------------------
                        
        
            #region system
            _GT(typeof(System.GC)),
            _GT(typeof(System.Net.NetworkInformation.NetworkInterface)),
            #endregion

            #region unity
//#if USING_DOTWEENING
       _GT(typeof(DG.Tweening.DOTween)),
       _GT(typeof(DG.Tweening.Tween)).SetBaseType(typeof(System.Object)).AddExtendType(typeof(DG.Tweening.TweenExtensions)),
       _GT(typeof(DG.Tweening.Sequence)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions)),
            _GT(typeof(DG.Tweening.Tweener)).AddExtendType(typeof(DG.Tweening.TweenSettingsExtensions)),
       _GT(typeof(DG.Tweening.LoopType)),
       _GT(typeof(DG.Tweening.Ease)),
       _GT(typeof(DG.Tweening.PathMode)),
       _GT(typeof(DG.Tweening.PathType)),
       _GT(typeof(DG.Tweening.RotateMode)),
//        _GT(typeof(Component)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
//        _GT(typeof(Transform)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
//        _GT(typeof(Light)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
//        _GT(typeof(Material)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
//        _GT(typeof(Rigidbody)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
//        _GT(typeof(Camera)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
//        _GT(typeof(AudioSource)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
        //_GT(typeof(UnityEngine.LineRenderer)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
        //_GT(typeof(TrailRenderer)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),    
//#else
                                         
            _GT(typeof(UnityEngine.Component)).AddExtendType(typeof(GetComponentsExtensions)),
            _GT(typeof(UnityEngine.Transform)).AddExtendType(typeof(TransformExtensions)).AddExtendType(typeof(DG.Tweening.ShortcutExtensions)),
            _GT(typeof(UnityEngine.Material)),
            _GT(typeof(UnityEngine.Light)),
            _GT(typeof(UnityEngine.Rigidbody)),
            _GT(typeof(UnityEngine.Camera)),
            _GT(typeof(UnityEngine.AudioSource)),
		    _GT(typeof(UnityEngine.AI.NavMeshPath)),
            _GT(typeof(UnityEngine.AI.NavMeshPathStatus)),
//#endif
            _GT(typeof(UnityEngine.AudioListener)),
            _GT(typeof(UnityEngine.Behaviour)),
            _GT(typeof(UnityEngine.MonoBehaviour)),        
            _GT(typeof(UnityEngine.GameObject)).AddExtendType(typeof(GetComponentsExtensions)),
            _GT(typeof(UnityEngine.TrackedReference)),
            _GT(typeof(UnityEngine.Application)),
            _GT(typeof(UnityEngine.RuntimePlatform)),
            _GT(typeof(UnityEngine.SceneManagement.SceneManager)),
            _GT(typeof(UnityEngine.SceneManagement.Scene)),
            _GT(typeof(UnityEngine.SceneManagement.LoadSceneMode)),
            _GT(typeof(UnityEngine.Physics)),
            _GT(typeof(UnityEngine.Physics2D)),
            _GT(typeof(UnityEngine.Collider)),
            _GT(typeof(UnityEngine.QueryTriggerInteraction)),
            _GT(typeof(UnityEngine.Time)),        
            _GT(typeof(UnityEngine.Texture)),
            _GT(typeof(UnityEngine.Texture2D)),
            _GT(typeof(UnityEngine.Sprite)),
            _GT(typeof(UnityEngine.Rect)),
            _GT(typeof(UnityEngine.Shader)),        
            _GT(typeof(UnityEngine.Renderer)),
            _GT(typeof(UnityEngine.MaterialPropertyBlock)),
            _GT(typeof(UnityEngine.Rendering.ShadowCastingMode)),
            _GT(typeof(UnityEngine.LightShadows)),
            _GT(typeof(UnityEngine.WWW)),
            _GT(typeof(UnityEngine.Screen)),        
            _GT(typeof(UnityEngine.CameraClearFlags)),
            _GT(typeof(UnityEngine.AudioClip)),        
            _GT(typeof(UnityEngine.AssetBundle)),
            _GT(typeof(UnityEngine.AssetBundleRequest)),
            _GT(typeof(UnityEngine.ParticleSystem)).AddExtendType(typeof(ParticleSystemExtensions)),
            _GT(typeof(UnityEngine.ParticleSystemRenderer)),
            _GT(typeof(UnityEngine.ParticleSystem.MinMaxCurve)),
            _GT(typeof(UnityEngine.AsyncOperation)).SetBaseType(typeof(System.Object)),        
            _GT(typeof(UnityEngine.LightType)),
            _GT(typeof(UnityEngine.SleepTimeout)),
//            _GT(typeof(UnityEngine.Terrain)),
            _GT(typeof(UnityEngine.ParticleSystem.MainModule)),
            _GT(typeof(UnityEngine.MeshFilter)),
            _GT(typeof(UnityEngine.Bounds)),
            _GT(typeof(UnityEngine.Mesh)),
            _GT(typeof(UnityEngine.PlayerPrefs)),
            _GT(typeof(UnityEngine.CullingGroup)),
            _GT(typeof(UnityEngine.BoundingSphere)),
            _GT(typeof(UnityEngine.CullingGroupEvent)),
            _GT(typeof(UnityEngine.SystemInfo)), 
            _GT(typeof(UnityEngine.Debug)), 

#if UNITY_5_3_OR_NEWER && !UNITY_5_6_OR_NEWER
        _GT(typeof(UnityEngine.Experimental.Director.DirectorPlayer)),
#endif
            _GT(typeof(UnityEngine.GUI)),
            _GT(typeof(UnityEngine.GUILayout)),
            _GT(typeof(UnityEngine.GUIStyle)),
            _GT(typeof(UnityEngine.GUISkin)),
            _GT(typeof(UnityEngine.Font)),

            _GT(typeof(UnityEngine.Animator)),
            _GT(typeof(UnityEngine.HumanBodyBones)),
            _GT(typeof(UnityEngine.AnimatorStateInfo)),
            _GT(typeof(UnityEngine.AnimatorClipInfo)),
            _GT(typeof(UnityEngine.RuntimeAnimatorController)),
            _GT(typeof(UnityEngine.Input)),
            _GT(typeof(UnityEngine.KeyCode)),
            _GT(typeof(UnityEngine.SkinnedMeshRenderer)),
            _GT(typeof(UnityEngine.Space)),
            _GT(typeof(UnityEngine.Rendering.RenderQueue)),

            _GT(typeof(UnityEngine.MeshRenderer)),
            _GT(typeof(UnityEngine.SpriteRenderer)),
#if !UNITY_5_4_OR_NEWER
            _GT(typeof(UnityEngine.ParticleEmitter)),
            _GT(typeof(UnityEngine.ParticleRenderer)),
            _GT(typeof(UnityEngine.ParticleAnimator)), 
#endif

            _GT(typeof(UnityEngine.BoxCollider)),
            _GT(typeof(UnityEngine.BoxCollider2D)),
            _GT(typeof(UnityEngine.MeshCollider)),
            _GT(typeof(UnityEngine.SphereCollider)),        
            _GT(typeof(UnityEngine.CapsuleCollider)),
        
            _GT(typeof(UnityEngine.Animation)),        
            _GT(typeof(UnityEngine.AnimationClip)).SetBaseType(typeof(UnityEngine.Object)),        
            _GT(typeof(UnityEngine.AnimationState)),
            _GT(typeof(UnityEngine.AnimationBlendMode)),
            _GT(typeof(UnityEngine.QueueMode)),  
            _GT(typeof(UnityEngine.PlayMode)),
            _GT(typeof(UnityEngine.WrapMode)),

            _GT(typeof(UnityEngine.QualitySettings)),
            _GT(typeof(UnityEngine.RenderSettings)),                                                   
            _GT(typeof(UnityEngine.BlendWeights)),           
            _GT(typeof(UnityEngine.RenderTexture)),  
            _GT(typeof(UnityEngine.TextAsset)),
            _GT(typeof(UnityEngine.PrimitiveType)),
            _GT(typeof(UnityEngine.Gizmos)),
            _GT(typeof(UnityEngine.AnimationCurve)),
            _GT(typeof(UnityEngine.Keyframe)),
            _GT(typeof(UnityEngine.ParticleSystemStopBehavior)),
            #endregion


            #region ngui
            _GT(typeof(UICamera)),
            _GT(typeof(UICamera.MouseOrTouch)),
            _GT(typeof(UIEventListener)),
            _GT(typeof(NGUITools)),
            _GT(typeof(UIRoot)),
            _GT(typeof(UIPanel)),
            _GT(typeof(UIGrid)),
            _GT(typeof(UITable)),
            _GT(typeof(UIRect)).AddExtendType(typeof(NGUI_Extensions)),
            _GT(typeof(UIRect.AnchorPoint)),
            _GT(typeof(UIPlayTween)),
            _GT(typeof(UITweener)),
            _GT(typeof(UITweener.Method)),
            _GT(typeof(TweenPosition)),
            _GT(typeof(TweenScale)),
            _GT(typeof(TweenAlpha)),
            _GT(typeof(TweenRotation)),
            _GT(typeof(TypewriterEffect)),
            _GT(typeof(UIScrollView)),
            _GT(typeof(UIScrollBar)),
            _GT(typeof(UIBasicSprite.Flip)),
            _GT(typeof(UI2DSprite)),
            _GT(typeof(UIToggle)),
            _GT(typeof(UIButtonColor.State)),
            _GT(typeof(AnimationOrTween.Direction)),
        	_GT(typeof(UITexture)),
            _GT(typeof(UIWrapContent)),
            _GT(typeof(UIPopupList)),
            _GT(typeof(UIInput)),
            _GT(typeof(UIWidget)).AddExtendType(typeof(NGUI_Extensions)),
            _GT(typeof(UIProgressBar)),
            _GT(typeof(System.Collections.Generic.List<EventDelegate>)).AddExtendType(typeof(NGUI_Extensions)),
            #endregion
        





            #region lua framework
            _GT(typeof(LuaInterface.Debugger)).SetNameSpace(null),          
            _GT(typeof(LuaFramework.Util)),
            _GT(typeof(LuaFramework.AppConst)),
            _GT(typeof(LuaFramework.LuaHelper)),
            _GT(typeof(LuaFramework.ByteBuffer)),
            _GT(typeof(LuaFramework.LuaBehaviour)),
            #endregion









            #region extend
            _GT(typeof(PlayerPrefsX)),
            _GT(typeof(UITextureEx)),
            _GT(typeof(UI2DSpriteEx)),
            // _GT(typeof(UI2DSpriteAnimationEx)),
            _GT(typeof(UILabelEx)).AddExtendType(typeof(NGUI_Extensions)),
            // _GT(typeof(UIModelPanel)),  
            _GT(typeof(AsyncOperationEx)),
            // _GT(typeof(UIScrollAnimationList)),
            // _GT(typeof(DelegateAutoSizeWrapContent)),
            _GT(typeof(SpriteEx)),
            _GT(typeof(UIButtonEx)),
            _GT(typeof(MD5Hash)),
            #endregion





            #region project framework
            _GT(typeof(SerializeEx.ISerializableFieldContainer)),
            _GT(typeof(SerializeEx.FieldDictionary)),
            _GT(typeof(SwitchConfig)),
            _GT(typeof(ResourceManager)),	
    		_GT(typeof(ObjectPool)),	
            _GT(typeof(HttpRequestManager)),
            _GT(typeof(HttpRequest)),
            _GT(typeof(RootWindowManager)),
            _GT(typeof(IUIAnimElem)),
            _GT(typeof(UIAnimElem)),
            _GT(typeof(UIAnimGroup)),
            _GT(typeof(WindowAnimType)),
            _GT(typeof(WindowManager)),
            _GT(typeof(WindowProxy)),
            _GT(typeof(Window)),
            _GT(typeof(RestrictControlRegionManager)),
            _GT(typeof(RegionInfo)),
            _GT(typeof(LangManager)),
            _GT(typeof(UnityEngine.SystemLanguage)),
            _GT(typeof(LangString)),
            _GT(typeof(CompileType)),
            _GT(typeof(VersionEx)),
            _GT(typeof(GuiUtil)),
            _GT(typeof(LabelPos)),
            _GT(typeof(MyEventObject)),
            // _GT(typeof(LuaObject)),
            _GT(typeof(DelayDestroy)),
            _GT(typeof(BundleVersionManager)),
            _GT(typeof(NewBundleManager)),
            _GT(typeof(ExternalResourceManager)),
            _GT(typeof(FileLog)),
            _GT(typeof(UnityListPools)),
            _GT(typeof(ArrayExtensions)),
            _GT(typeof(PhysicsExtend)),
            #endregion



            _GT(typeof(Login)),
            
            #region custom component
            
            #endregion





            _GT(typeof(DialogData)),
            _GT(typeof(OneBtnDialog)),
            _GT(typeof(TwoBtnDialog)),

           
            #region serializable class
        


    _GT(typeof(PipeGameWindow)),
            
    #endregion
};

    public static System.Collections.Generic.List<System.Type> dynamicList = new System.Collections.Generic.List<System.Type>()
    {
        typeof(UnityEngine.MeshRenderer),
#if !UNITY_5_4_OR_NEWER
        typeof(ParticleEmitter),
        typeof(ParticleRenderer),
        typeof(ParticleAnimator),
#endif

            typeof(UnityEngine.BoxCollider),
            typeof(UnityEngine.BoxCollider2D),
            typeof(UnityEngine.MeshCollider),
            typeof(UnityEngine.SphereCollider),
            typeof(UnityEngine.CharacterController),
            typeof(UnityEngine.CapsuleCollider),

            typeof(UnityEngine.Animation),
            typeof(UnityEngine.AnimationClip),
            typeof(UnityEngine.AnimationState),

            typeof(UnityEngine.BlendWeights),
            typeof(UnityEngine.RenderTexture),
            typeof(UnityEngine.Rigidbody),
            typeof(UnityEngine.SystemInfo),
    };

    //重载函数，相同参数个数，相同位置out参数匹配出问题时, 需要强制匹配解决
    //使用方法参见例子14
    public static System.Collections.Generic.List<System.Type> outList = new System.Collections.Generic.List<System.Type>()
    {
        
    };
        
    //ngui优化，下面的类没有派生类，可以作为sealed class
    public static System.Collections.Generic.List<System.Type> sealedList = new System.Collections.Generic.List<System.Type>()
    {
            typeof(UnityEngine.Transform),
        typeof(UIRoot),
        typeof(UICamera),
        typeof(UIViewport),
       // typeof(UIPanel),
//        typeof(UILabel),
        typeof(UIAnchor),
        typeof(UIAtlas),
        typeof(UIFont),
//        typeof(UITexture),
        typeof(UISprite),
        typeof(UIGrid),
        typeof(UITable),
        /*
        typeof(UIWrapGrid),
        typeof(UIInput),
        typeof(UIScrollView),
        typeof(UIEventListener),
        typeof(UIScrollBar),
        typeof(UICenterOnChild),
        typeof(UIScrollView),        
        typeof(UIButton),
        typeof(UITextList),
        typeof(UIPlayTween),
        typeof(UIDragScrollView),
        typeof(UISpriteAnimation),
        typeof(UIWrapContent),
        typeof(TweenWidth),
        typeof(TweenAlpha),
        typeof(TweenColor),
        typeof(TweenRotation),
        typeof(TweenPosition),
        typeof(TweenScale),
        typeof(TweenHeight),
        typeof(TypewriterEffect),
        typeof(UIToggle),
        typeof(Localization),
        */
    };

    public static BindType _GT(System.Type t)
    {
        return new BindType(t);
    }

    public static DelegateType _DT(System.Type t)
    {
        return new DelegateType(t);
    }    
}
